package grg.learn.compose.network

import okhttp3.HttpUrl
import okhttp3.Interceptor
import okhttp3.OkHttpClient
import retrofit2.Retrofit
import java.net.URL

/**
 * create by iso88591 at 2021/8/31
 * okhttpClient
 */
inline fun Retrofit.Builder.okhttpClient(block: OkHttpClient.Builder.() -> Unit) {
    val builder = OkHttpClient.Builder()
    block(builder)
    client(builder.build())
}

/**
 * create by iso88591 at 2021/8/31
 * retrofit
 */
fun retrofit(block: Retrofit.Builder.() -> Unit): Retrofit {
    val builder = Retrofit.Builder()
    block(builder)
    return builder.build()
}
